package com.yunji.storage.enums;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.storage.enums
 * @Title: DraftStatus
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-28 19:36:38      V1.0        HuaAo       新建类
 */

public enum DraftStatus {
    EXIST(0, "存在"),
    ABSENT(1, "不存在");

    private final Integer code;
    private final String text;

    DraftStatus(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code) {
        DraftStatus[] enums = DraftStatus.values();
        for (DraftStatus e : enums) {
            if (Objects.equals(e.code, code)) {
                return e.text;
            }
        }
        return null;
    }
}